package com.personal.mapper;

import com.personal.pojo.TReserve;
import com.personal.pojo.TReserveExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TReserveMapper {
    int countByExample(TReserveExample example);

    int deleteByExample(TReserveExample example);

    //根据id删除预约到期的会员预约记录
    int deleteByPrimaryKey(Integer reserveid);

    int insert(TReserve record);

    //预约教练，插入新记录
    int insertSelective(TReserve record);

    List<TReserve> selectByExample(TReserveExample example);

    TReserve selectByPrimaryKey(Integer reserveid);

    int updateByExampleSelective(@Param("record") TReserve record, @Param("example") TReserveExample example);

    int updateByExample(@Param("record") TReserve record, @Param("example") TReserveExample example);

    int updateByPrimaryKeySelective(TReserve record);

    int updateByPrimaryKey(TReserve record);

    //根据会员id查询会员预约的所有教练
    List selectAllCoach(Integer memid);
    //根据教练id查询教练名下的所有会员
    List selectAllMem(Integer coachid);

    //根据用户，教练id查，避免重复
    TReserve selectByMemCoa(@Param("memid")Integer memid,@Param("coachid")Integer coachid);

}